Skip to main content
Feedback

Configuring policy path mode for a deployed API

Policy Path Mode defines the sequence of policy paths applied to an API request or response. These control the execution of different policy paths, letting you customize how you consume and manage APIs when the Gateway applies multiple policy paths for an API. It supports the All Match and Best Match modes.

All Match

In All Match mode, the Gateway executes policies from all paths that match the path of an API request. This is the default policy mode.

When multiple policy paths apply to an API, the Gateway orders the paths alphabetically. If path mode is All Match, the Gateway executes all policy paths that match the API request in the same order.

Best Match

In Best Match mode, the Gateway executes policies from the single path that most closely matches the path of an API request.

Here, the text part of the path will take precedence over a path parameter. It reads the text from left to right, comparing each part of the path. It compares all the policy paths and selects the best-matching path.

Example

For example, if you have policies in path “/” and “/api” and “/api/test”

  • For the API call http://test.com/api/test in All Match mode, this will execute policies defined in all paths - "/" , "/api", and "/api/test".

  • For the API call http://test.com/api/test in Best Match mode, this executes policies defined in the closest path, that is, "/api/test".

Prerequisites

  • You have a deployed API in API Management.

Procedure

  1. In API Management, select Configure APIs and Applications > Manage API. The page displays a list of deployed APIs.

  2. Select any deployed API.

  3. Navigate to the Settings tab and select Policy Path Mode.

  4. Select All Match or Best Match mode.

  5. Click Save.

    Policy Path Mode settings showing All Match and Best Match options

On this Page